<%@page import="java.util.List"%>
<%@page import="com.jfinal.plugin.activerecord.Page"%>
<%@page import="com.hongye.app.model.PaymentModel"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" isELIgnored="false"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!doctype html>
<html class="fixed">

	<head>

		<!-- Basic -->
		<meta charset="UTF-8">
		<meta name="keywords" content="HTML5 Admin Template" />
		<meta name="description" content="Porto Admin - Responsive HTML5 Template">
		<meta name="author" content="okler.net">
		<!-- Mobile Metas -->
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<!-- Web Fonts  -->
		<!-- Vendor CSS -->
		<link rel="stylesheet" href="../admin/css/bootstrap.css" />
		<link rel="stylesheet" href="../admin/css/font-awesome/css/font-awesome.css" />
        <link rel="stylesheet" href="../admin/css/select2.css" />
		<!-- Theme CSS -->
		<link rel="stylesheet" href="../admin/css/theme.css" />
		<!-- Skin CSS -->
		<link rel="stylesheet" href="../admin/css/default.css" />
		<!-- Theme Custom CSS -->
		<!-- Theme Custom ../admin/css -->
		<script src="../admin/js/modernizr.js"></script>
		<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
		
	</head>

	<body>
		<section role="main" class="content-body" style="margin-top: 50px;">
			<!-- start: page -->
			<section class="panel">
				<header class="panel-heading">													
					<h2 class="panel-title">交易管理</h2>
				</header>
				<div class="panel-body">
				<div >
					<form id="screenform" method="post"  action="../payment/screen" 
						style="
					    float: left;
					    margin-bottom: 3rem;
					    margin-right: 3rem;
					    margin-left: 1rem;
						" >	
					搜索：<input type="text" name="startTime" id="startTime" placeholder="01/01/2017">
					&nbsp;至&nbsp;<input type="text" name="endTime" id="endTime" placeholder="01/01/2017">
					状态：<input type="radio" name="state" value="0" />申请支付
						 <input type="radio" name="state" value="1" />支付取消
						 <input type="radio" name="state" value="2" />支付完成
					<button type="submit"  class="btn btn-primary" >筛选</button>
					</form>
					<form method="post"  action="../payment/download?ids=${ids}" >
					<button type="submit" class="btn btn-primary btn-right" >下载</button>
					</form>
					<hr>
				</div>
					<table class="table table-bordered table-striped mb-none" id="datatable-default">
						<thead>
							<tr>
								<th class="hidden-phone center">序号</th>
								<th class="hidden-phone center">收款/付款</th>
								<th class="hidden-phone center">订单编号</th>
								<th class="hidden-phone center">用户手机号</th>
								<th class="hidden-phone center">用户昵称</th>
								<th class="hidden-phone center">交易渠道</th>
								<th class="hidden-phone center">用户交易账号</th>
								<th class="hidden-phone center">支付金额（元）</th>
								<th class="hidden-phone center">创建时间</th>
								<th class="hidden-phone center">支付状态</th>
								<th class="hidden-phone center">详情</th>
							</tr>
						</thead>
						<tbody>
							<%List<PaymentModel> paymentlist=(List)request.getAttribute("paymentlist");
								for(int i=1;i<=paymentlist.size();i++){
									PaymentModel pay=paymentlist.get(i-1);
								%>
								<tr class="gradeA">
									<td class="center hidden-phone" ><%=i %></td>
									<td class="center hidden-phone"><%int type=pay.getInt("type"); 
									if(type==0){%>
									<span class="label label-success">收款</span>
									<%}else if(type==1){%>
									<span class="label label-primary">付款</span>
									<%}%></td>
									<td class="center hidden-phone"><%=pay.get("ordersn")%></td>
									<td class="center hidden-phone"><%=pay.get("user_phone") %></td>
									<td class="center hidden-phone"><%=pay.get("nick") %></td>
									<td class="center hidden-phone"><%String channel=pay.getStr("channel");
									if(channel.equals("alipay")){out.println("支付宝");}else{out.println("微信");}%></td>
									<td class="center hidden-phone"><%=pay.get("payment_account") %></td>
									<td class="center hidden-phone"><%=pay.get("money") %>元</td>
									<td class="center hidden-phone"><%=pay.get("c_time") %></td>
									<td class="center hidden-phone"><%int state=pay.getInt("state"); 
									if(state==0){%>
									<span class="label label-info">申请支付</span>
									<%}else if(state==1){%>
									<span class="label label-default">支付取消</span>
									<%}else if(state==2){%>
									<span class="label label-success">支付完成</span>
									<%}else if(state==3){%>
									<span class="label label-warning">退款完成</span>
									<%}%></td>
									<td class="center hidden-phone"><a href="../payment/paymentDetail?paymentid=<%=pay.get("id")%>">详情</td>
								</tr>
								<%} %>
						</tbody>
					</table>
				</div>
			</section>
		</section>
		<!-- Specific Page Vendor -->
		<!-- Vendor -->
		<script src="../admin/js/jquery.js"></script>
		<script src="../admin/js/layer.js"></script>
		<script src="../admin/js/jquery-browser-mobile/jquery.browser.mobile.js"></script>
		<script src="../admin/js/bootstrap/js/bootstrap.js"></script>
		<script src="../admin/js/nanoscroller/nanoscroller.js"></script>
		<script src="../admin/js/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
		<script src="../admin/js/magnific-popup/magnific-popup.js"></script>
		<script src="../admin/js/jquery-placeholder/jquery.placeholder.js"></script>
		
		<!-- Specific Page Vendor -->
	<!--	<script src="js/select2.js"></script>-->
		<script src="../admin/js/jquery-datatables/media/js/jquery.dataTables.js"></script>
		<script src="../admin/js/jquery-datatables-bs3/assets/js/datatables.js"></script>
		
		<!-- Theme Base, Components and Settings -->
		<script src="../admin/js/theme.js"></script>
		
		<!-- Theme Custom -->
		<script src="../admin/js/theme.custom.js"></script>
		
		<!-- Theme Initialization Files -->
		<script src="../admin/js/theme.init.js"></script>


		<!-- Examples -->
		<script src="../admin/js/tables/examples.datatables.default.js"></script>
		<script src="../admin/js/tables/examples.datatables.row.with.details.js"></script>
		<script src="../admin/js/tables/examples.datatables.tabletools.js"></script>
		<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
		<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
		<script>
		$( function() {
		  $( "#startTime" ).datepicker();
		} );
		$( function() {
		  $( "#endTime" ).datepicker();
		} );
		</script>
	</body>

</html>